<template>
  <el-carousel :interval="4000" type="card" height="200px">
    <el-carousel-item v-for="item in 6" :key="item">
      <h3 text="2xl" justify="center">{{ item }}</h3>
    </el-carousel-item>
  </el-carousel>
  <br/>
  <el-tabs v-model="activeName" class="demo-tabs" @tab-click="handleClick">
    <el-tab-pane name="first">
        <template #label>
            <span class="custom-label">力扣精选</span>
        </template>
        <br>
        <div>新书上架
            <el-row :gutter="20">
                <el-col :span="6"><div class="grid-content ep-bg-purple" /><BooKCard :book="book1"/></el-col>
                <el-col :span="6"><div class="grid-content ep-bg-purple" /></el-col>
                <el-col :span="6"><div class="grid-content ep-bg-purple" /></el-col>
                <el-col :span="6"><div class="grid-content ep-bg-purple" /></el-col>
            </el-row>
        </div>
        <br>
        <div>最受关注</div>
        <br>
        <div>模拟演练</div>
        <br>
        <div>面试笔记</div>
        
        
        <br>

    </el-tab-pane>
    <el-tab-pane name="second">
        <template #label>
            <span class="custom-label">算法与数据结构</span>
        </template>
    </el-tab-pane>
    <el-tab-pane label="八股文" name="third">
        <template #label>
            <span class="custom-label">八股文</span>
        </template>
    </el-tab-pane>
    <el-tab-pane label="岗位必备" name="fourth">
        <template #label>
            <span class="custom-label">岗位必备</span>
        </template>
    </el-tab-pane>
    <el-tab-pane label="会员专享" name="fifth">
        <template #label>
            <span class="custom-label">会员专享</span>
        </template>
    </el-tab-pane>
  </el-tabs>
</template>

<script setup>
import { ref } from 'vue'
import BooKCard from '@/components/book_card.vue';

const activeName = ref('first')

const handleClick = () => {
  console.log(tab)
}

const book1 = {
  imageUrl: 'https://via.placeholder.com/150',
  title: '深入理解算法与数据结构',
  description: '这本书讲解了各种数据结构和算法的应用。',
  chapters: 12,
  sections: 50,
  views: 1500,
  price: 99,
  originalPrice: 199
};

</script>

<style scoped>

.el-row {
  margin-bottom: 20px;
}
.el-row:last-child {
  margin-bottom: 0;
}
.el-col {
  border-radius: 4px;
}

.grid-content {
  border-radius: 4px;
  min-height: 36px;
}


.demo-tabs {
  padding: 50px;
  color: #6b778c;
  font-size: 20px;
  font-weight: 600;
}

.custom-label{
    font-size: 18px;
    font-weight: bold;
}

.el-carousel__item h3 {
  color: #475669;
  opacity: 0.75;
  line-height: 200px;
  margin: 0;
  text-align: center;
}

.el-carousel__item:nth-child(2n) {
  background-color: #99a9bf;
}

.el-carousel__item:nth-child(2n + 1) {
  background-color: #d3dce6;
}
</style>